package org.example.nebula.common.config;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import springfox.documentation.service.ApiInfo;
import springfox.documentation.service.Contact;
import springfox.documentation.spi.DocumentationType;
import springfox.documentation.spring.web.plugins.Docket;
import springfox.documentation.swagger2.annotations.EnableSwagger2;

import java.util.ArrayList;

/*
 * @author: jszhang
 * @date: 2023/2/23-17:56
 */

@Configuration
@EnableSwagger2   //开启swagger
public class SwaggerConfig {

    //配置swagger的Docket的bean实例
    @Bean
    public Docket docket(){
        Docket docket = new Docket(DocumentationType.SWAGGER_2);
        docket.apiInfo(apiInfo());
        return docket;
    }
    //配置swagger信息=apiInfo
    private ApiInfo apiInfo(){
        Contact DEFAULT_CONTACT = new Contact("CA", "www.baidu.com", "CA@qq.com");
        return new ApiInfo(
                "swaggerAPI文档",
                "图数据库迁移",
                "1.0",
                "urn:tos",
                DEFAULT_CONTACT, "Apache 2.0",
                "www.baidu.com",
                new ArrayList());
    }
}
